print('=====遍历字典的keys')
# 需求：
# 定义个人字典：姓名：张三，年龄：18，性别：男
dict1={'name':'张三','age':'18','sex':'男'}
# 遍历字典的key
for i in dict1:
    print(i)
for key in dict1.keys():
    print(key)

print('=====遍历字典的values')

for v in dict1.values():
    print(v)

print('=====遍历字典的keys和values')

for k,v in dict1.items():
    print('key=',k,'value=',v)


